package com.ssii.www.myproject.common.util;

import lombok.Data;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * 兼容easyui的分页
 */
@Data
public class PageList<T>  {
  //每页的数据
  private List<T> rows;
  //总共的页数
  private int page;
  //总共条数
  private long total;
  public PageList(){}
  public PageList(Page<T> page){
    this.rows = page.getContent();
    this.page = page.getTotalPages();
    this.total = page.getNumberOfElements();
  }
}
